<?php
namespace Backoffice\Form;

use Zend\Form\Fieldset;

class BoutiqueFieldset extends Fieldset
{
    public function init()
    {
        $em = $this->getFormFactory()->getFormElementManager()->getServiceLocator()->get('doctrine.entitymanager.orm_default');
        $this->setHydrator(new \DoctrineModule\Stdlib\Hydrator\DoctrineObject($em, 'Backoffice\Model\Entity\Boutique'));
        
        $this->add(array(
            'type' => 'text',
            'name' => 'nom',
            'attributes' => array(
                'class' => 'form-control',
            ),
        ));
        
        $this->add(array(
            'type' => 'textarea',
            'name' => 'description',
            'attributes' => array(
                'rows' => 4,
                'cols' => 100,
                'class' => 'form-control ckeditor',
            ),
        ));
        
        $this->add(array(
            'type' => 'submit',
            'name' => 'submit',
            'options' => array('label' => 'Enregister les modifications'),
            'attributes' => array('class' => 'btn btn-success'),
        ));
    }
}
